package com.ykdl.member.kid.beans;

import java.io.Serializable;
import java.util.ArrayList;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ykdl.member.kid.models.FileMetas;

import net.wxxr.http.interfaces.IJsonParser;

/**
 * 天使日记
 * @author Pengfei
 *
 */
public class DiaryBean implements Serializable, IJsonParser {

	/**
	 * {
            "actor_display_name": "xiaoxiao1",
            "actor_id": 6143,
            "baby_birthday_time": 1388047495,
            "created_time": 1394448171.325898,
            "diary_id": 18,
            "file_ids": [
                26
            ],
            "file_metas": [
                {
                    "download_urls": {
                        "big": {
                            "height": 200,
                            "url": "http://172.16.22.11/group1/M00/00/13/rBAWC1MNktaAX9hjAAKzx-Tg0dw140_big.png",
                            "width": 200
                        },
                        "middle": {
                            "height": 100,
                            "url": "http://172.16.22.11/group1/M00/00/13/rBAWC1MNktaAX9hjAAKzx-Tg0dw140_middle.png",
                            "width": 100
                        },
                        "origin": {
                            "height": 400,
                            "url": "http://172.16.22.11/group1/M00/00/13/rBAWC1MNktaAX9hjAAKzx-Tg0dw140.png",
                            "width": 400
                        },
                        "small": {
                            "height": 50,
                            "url": "http://172.16.22.11/group1/M00/00/13/rBAWC1MNktaAX9hjAAKzx-Tg0dw140_small.png",
                            "width": 50
                        }
                    },
                    "file_id": 26,
                    "file_name": "haruhi.jpg",
                    "is_image": true,
                    "mime_type": "image/jpeg"
                }
            ],
            "is_delete": false,
            "is_share": false,
            "modified_time": null,
            "type": 1
        }
	 */
	private String actor_display_name;
	private int actor_id;
	private float baby_birthday_time;
	private float created_time;
	private long diary_id;
	private int[] file_ids;
	private ArrayList<FileMetas> file_metas;
	private boolean is_delete;
	private boolean is_share;
	private float modified_time;
	private int type;
	
	public String getActor_display_name() {
		return actor_display_name;
	}

	public void setActor_display_name(String actor_display_name) {
		this.actor_display_name = actor_display_name;
	}

	public int getActor_id() {
		return actor_id;
	}

	public void setActor_id(int actor_id) {
		this.actor_id = actor_id;
	}

	public float getBaby_birthday_time() {
		return baby_birthday_time;
	}

	public void setBaby_birthday_time(float baby_birthday_time) {
		this.baby_birthday_time = baby_birthday_time;
	}

	public float getCreated_time() {
		return created_time;
	}

	public void setCreated_time(float created_time) {
		this.created_time = created_time;
	}

	public long getDiary_id() {
		return diary_id;
	}

	public void setDiary_id(long diary_id) {
		this.diary_id = diary_id;
	}

	public int[] getFile_ids() {
		return file_ids;
	}

	public void setFile_ids(int[] file_ids) {
		this.file_ids = file_ids;
	}



	public ArrayList<FileMetas> getFile_metas() {
		if(file_metas == null){
			file_metas = new ArrayList<FileMetas>();
		}
		return file_metas;
	}

	public void setFile_metas(ArrayList<FileMetas> file_metas) {
		this.file_metas = file_metas;
	}

	public boolean isIs_delete() {
		return is_delete;
	}

	public void setIs_delete(boolean is_delete) {
		this.is_delete = is_delete;
	}

	public boolean isIs_share() {
		return is_share;
	}

	public void setIs_share(boolean is_share) {
		this.is_share = is_share;
	}

	public float getModified_time() {
		return modified_time;
	}

	public void setModified_time(float modified_time) {
		this.modified_time = modified_time;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Override
	public IJsonParser parse(String json) throws Exception {
		if (!TextUtils.isEmpty(json)) {
			GsonBuilder builder = new GsonBuilder();
			Gson gson = builder.create();
			return gson.fromJson(json, DiaryBean.class);
		}
		return null;
	}

}
